package com.trkj.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
/**
 * @author makejava
 * @since 2023-08-27 17:13:35
 * @Description:Druid数据源的配置类，spring其实会自动为注入在配置文件中（或是nacos服务中心）配置好的Druid数据源。
 * 也就是说这个类以及DataSourceConfig类与DataSourceConfig类其实可以不用，但如果需要针对该业务模块或是微
 * 服务在数据源配置上有不同的配置，如每个微服务需要连接到不同的数据库，这时就可以在启用这两个配置类
 *
 * @Autowired private DataSource dataSource;
 */
@Configuration
@Data
@ConfigurationProperties(prefix = "spring.datasource.druid")
public class DruidConfig {
    private String validationQuery;
    private int initialSize;
    private int minIdle;
    private int maxActive;
    private int minEvictableIdleTimeMillis;
    private boolean testOnBorrow;
    private boolean testWhileIdle;
    private boolean removeAbandoned;
    private int removeAbandonedTimeout;
    private boolean logAbandoned;
    private boolean poolPreparedStatements;
    private int maxOpenPreparedStatements;
    private String filters;
}
